package com.twu.biblioteca;

import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;

public class Console {

    BufferedReader bufferedReader;

    public Console() {
        bufferedReader = new BufferedReader(new InputStreamReader(System.in));
    }

    public int getIntergerInputFromUser() throws IOException {
        return Integer.parseInt(bufferedReader.readLine());
    }

    public String getStringInputFromUser() throws IOException {
        return bufferedReader.readLine();
    }

    public void print(String outputString) {
        System.out.println(outputString);
    }

    public String formatString(String inputString) {
        int pad = 20;
        StringBuilder formattedString = new StringBuilder();

        String [] input = inputString.split(" ");
        for (int i = 0; i < input.length; i++) {
            formattedString.append(String.format("%1$" + pad + "s", input[i]));
        }
        return formattedString.toString();
    }
}
